﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace StoreManager.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {  
            ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
            // Check whether has been logged in or not
            string isLogin = (string)"true";//this.ControllerContext.HttpContext.Session["IsLogin"];
            if("true".Equals(isLogin)) {
                return View();
            } else {
                ViewBag.Message = "Your user Name and password is not correct";
                return RedirectToAction("Login", "Account");
            }
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your app description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
        public ActionResult Error()
        {
            ViewBag.Message = "System error, please contact with adminstrator.";
            return View();
        }
    }
}
